# Maintainer: Andy Postnikov <apostnikov@gmail.com>
pkgname=php7-pecl-grpc
_pkgreal=grpc
pkgver=1.31.0
pkgrel=0
pkgdesc="PHP extension provide a concrete implementation of the gRPC protocol, layered over HTTP/2."
url="https://pecl.php.net/package/grpc"
arch="all !s390x !ppc64le !armv7 !armhf !x86" # armv7, armhf, x86: build failures
license="Apache-2.0"
depends="php7-common"
makedepends="php7-dev autoconf re2c openssl-dev zlib-dev linux-headers"
source="$pkgname-$pkgver.tgz::https://pecl.php.net/get/$_pkgreal-$pkgver.tgz"
builddir="$srcdir"/$_pkgreal-$pkgver

build() {
	phpize7
	./configure --prefix=/usr --with-php-config=php-config7
	make
}

check() {
	# Test suite is not a part of pecl release.
	php7 -d extension="$builddir"/modules/$_pkgreal.so --ri $_pkgreal
}

package() {
	make INSTALL_ROOT="$pkgdir"/ install
	install -d "$pkgdir"/etc/php7/conf.d
	echo "extension=$_pkgreal.so" > "$pkgdir"/etc/php7/conf.d/50_$_pkgreal.ini
}

sha512sums="41aa2f81a4bc06e2f0e65fa36d0e8fafefa8a2fc98ed329386c7ef26c09e97e674374a246cc52ed24e95c579d4a2bb12632a94cc216cd8c43eb33417e30bc29c  php7-pecl-grpc-1.31.0.tgz"
